﻿using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Xms.Abp.Caching;

public interface IGeoCache
{
    Task RemoveAsync(CancellationToken cancellationToken = default);
    Task<bool> KeyExistsAsync(CancellationToken cancellationToken = default);

    Task SetAsync(string member, double longitude, double latitude, CancellationToken cancellationToken = default);
    Task SetAsync(string member, GeoPositionItem position, CancellationToken cancellationToken = default);
    Task SetManyAsync(IEnumerable<KeyValuePair<string, GeoPositionItem>> geos, CancellationToken cancellationToken = default);
    Task<GeoPositionItem> GetAsync(string member, CancellationToken cancellationToken = default);
    Task<IEnumerable<KeyValuePair<string, GeoPositionItem>>> GetManyAsync(string[] members, CancellationToken cancellationToken = default);
    Task<IEnumerable<KeyValuePair<string, GeoPositionItem>>> GetManyAsync(IEnumerable<string> members, CancellationToken cancellationToken = default);
    Task<bool> RemoveAsync(string member, CancellationToken cancellationToken = default);
    Task<double?> DistanceAsync(string member1, string member2, CancellationToken cancellationToken = default);
    Task<GeoRadiusItem[]> RadiusAsync(string member, double radius, CancellationToken cancellationToken = default);
    Task<GeoRadiusItem[]> RadiusAsync(double longitude, double latitude, double radius, CancellationToken cancellationToken = default);
}
//public interface IGeoDistributedCache<TOptions> : IGeoDistributedCache
//    where TOptions : XmsCacheOptions
//{
//}
